<!DOCTYPE html>
<html>
<head>
    <title>NativeUploader的demo</title>
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta name="format-detection" content="telephone=no" />
    <link rel="apple-touch-icon-precomposed" href="http://a.tbcdn.cn/mw/s/hi/tbtouch/images/touch-icon.png" />
    <script src="http:http://g.tbcdn.cn/kissy/k/1.4.2/seed-min.js"></script>
    <script src="http://g.tbcdn.cn/mtb/??lib-windvane/1.2.3/api.js,lib-windvane/1.2.3/bridge.js"></script>
    <script src="http://g.tbcdn.cn/mtb/??lib-env/1.1.10/env.js,lib-httpurl/1.1.4/httpurl.js,lib-callapp/1.0.18/callapp.js"></script>
</head>
<body>
<h2>NativeUploader的demo</h2>
<p>上传图片</p>
<ul id="J_UploaderQueue" class="native-uploader grid">
    <li class="J_NativeUploader g-u uploader-up">
        <label class="uploader-label">
            <p>上传凭证</p>
            <small>（最多5张）</small>
        </label>
    </li>
</ul>
<input id="J_Urls" value="attachments" type="hidden">

<script>
    var S = KISSY;
    if (S.Config.debug) {
        var srcPath = "../../";
        S.config({
            packages:[
                {
                    name: "gallery/uploader",
                    path: srcPath,
                    charset: "utf-8",
                    ignorePackageNameInUri: true
                }
            ]
        });
    }

    KISSY.use('gallery/uploader/1.5.4/nativeUploader,gallery/uploader/1.5.4/themes/nativeUploader/,gallery/uploader/1.5.4/plugins/urlsInput/urlsInput,gallery/uploader/1.5.4/plugins/auth/auth,gallery/uploader/1.5.4/plugins/callapp/callapp,gallery/uploader/1.5.4/themes/nativeUploader/style.css',function(S,NativeUploader,nativeTheme,UrlsInput,Auth,Callapp){
        var nativeUploader = new NativeUploader({
            target:'.J_NativeUploader'
        });
        nativeUploader.theme(new nativeTheme({
            queueTarget:'#J_UploaderQueue'
        }));
        nativeUploader.plug(new UrlsInput({target:'#J_Urls',useName:true}));
        nativeUploader.plug(new Auth({
            max:5
        }));
        nativeUploader.plug(new Callapp({
            url:'taobao://trade.taobao.com/trade/detail/trade_item_detail.htm'
        }));
/*        nativeUploader._addFile('1.jpg');
        S.later(function(){
            nativeUploader._progress(50,'1.jpg')
        },1000);
        S.later(function(){
            nativeUploader._success("http://img04.taobaocdn.com/bao/uploaded/i4/T1ReZnFhpeXXXXXXXX_!!0-item_pic.jpg",'1.jpg');
        },2000)*/
/*        S.later(function(){
            nativeUploader._error("上传失败",'1.jpg');
        },3000)*/
    });
</script>
</body>
</html>